package com.itheima;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author 29143
 */
@MapperScan("com.itheima.order.mapper")
@SpringBootApplication
@EnableFeignClients("com.itheima.feign.client")//开启feign的功能
public class OrderApplication {
    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class,args);
    }

    @Bean
    @LoadBalanced// 开启负载均衡
    RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
